package edu.uclmgmu.bacteriosec.aspects.common;

import org.aspectj.lang.JoinPoint;

privileged aspect GenericTracer2 extends IndentedLogging {
    declare precedence: GenericTracer, *;
 
    protected pointcut loggingOperations():
        (execution(* *(..)) || execution(*.new(..)))
        && !within(IndentedLogging+) && !within(edu.uclmgmu.*.*.*.*);
 
    protected void beforeLog(String indent, JoinPoint joinPoint) {
        log.info(indent + "Entering ["
                + joinPoint.getSignature().getDeclaringTypeName() + "."
                + joinPoint.getSignature().getName() + "]");
    }
 
    protected void afterLog(String indent, JoinPoint joinPoint) {
    	log.info(indent + "Exiting ["
                + joinPoint.getSignature().getDeclaringTypeName() + "."
                + joinPoint.getSignature().getName() + "]");
    }
}